<?php

namespace app\api\validate;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'old_password' => 'require',
        'new_password' => 'require',
        're_new_password' => 'require',
        'real_name' => 'require',
        'id_card' => 'require',
        'zm_img' => 'require',
        'fm_img' => 'require'
    ];

    protected $message = [
        'old_password.require' => '原登录密码不能为空',
        'new_password.require' => '新登录密码不能为空',
        're_new_password.require' => '二次密码不能为空',
        're_new_password.confirm' => '两次密码不一致',
        'real_name.require' => '真实姓名不能为空',
        'id_card.require' => '身份证号码不能为空',
        'zm_img.require' => '身份证正面必须上传',
        'fm_img.require' => '身份证反面必须上传'
    ];

    protected $scene = [
        'auth' => ['real_name','id_card','zm_img','fm_img'],
        'editPassword' => ['old_password','new_password','re_new_password'],
        'editPayPassword' => ['old_password','new_password','re_new_password'],
    ];
}
